<template>
    <div id="login-item">
      <el-form ref="form" v-model="form" label-width="60px">
        <el-form-item  label="用户名">
          <el-input
            placeholder="请输入用户名"
            prefix-icon="el-icon-user"
            v-model="form.loginName"
            clearable>
          </el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input
            placeholder="请输入密码"
            prefix-icon="el-icon-lock"
            v-model="form.password"
            show-password
            clearable>
          </el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="login">登录</el-button>
        </el-form-item>
      </el-form>
    </div>
</template>

<script>
    export default {
        name: "login-item",
        data(){
          return{
            form:{
              loginName:'',
              password:'',
            },

          }
        },
      methods:{
          login(){
            sessionStorage.setItem("sessionId", '');
            sessionStorage.setItem('userInfo','')
            this.$emit('login',this.form)
          }
      }
    }
</script>

<style scoped>

</style>
